#ifndef CHARACTER_H
#define CHARACTER_H

#pragma warning(disable: 4018)
#pragma warning(disable: 4290)

class character_error : public std::logic_error 
{
public:
	character_error(const std::string &error) : logic_error(error) { }
};

class Character{
private:
       // Variables
       std::string name_;
       std::vector<class Item*> items_;
       std::vector<class Node*> walkPath_;
       class Item* leftHand_;
       class Item* rightHand_;
       struct SDL_Rect charRect_;
       struct SDL_Surface *dirDown_[16];
       struct SDL_Surface *dirDownLeft_[16];
       struct SDL_Surface *dirLeft_[16];
       struct SDL_Surface *dirUpLeft_[16];
       struct SDL_Surface *dirUp_[16];
       struct SDL_Surface *dirUpRight_[16];
       struct SDL_Surface *dirRight_[16];
       struct SDL_Surface *dirDownRight_[16];
       int charDirection_;
       int charFrame_;
       int charX_;
       int charY_;
       int walkingToX_;
       int walkingToY_;
       void walking();

       // Methods
       std::string createLoadString(std::string initpath, std::string suffix, int num);
       std::vector<class Node*> getWalkPath(class Location*, int, int, class SDLMap*);
public:
       // Methods
       std::vector<class Item*> getAllItems();
       Character(std::string name, std::string character, int x, int y) throw(character_error);
       ~Character();
       std::string name() const;
       std::string items();
       void add(class Item*);
       void remove(class Item*);
       bool find(std::string);
       Item* getItem(std::string);
       Item* getItem(int num);
       Item* getLeftHand() const;
       Item* getRightHand() const;
       int equipLeftHand(class Item*);
       int equipRightHand(class Item*);
       Item* removeLeftHandItem();
       Item* removeRightHandItem();
       void render(struct SDL_Surface *screen);
       void createWalkPath(class Location*, int, int, class SDLMap*);
       void walk(class Location*, class SDLMap*);
       int getX() const;
       int getY() const;
};

#endif
